﻿using Coldairarrow.Entity.Goods;
using Coldairarrow.Entity.PersonalCenter;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Text;

namespace Coldairarrow.Entity.DTO
{
    public class BTB_GoodsDto
    {
        public String BId { get; set; }

        /// <summary>
        /// 商品Id
        /// </summary>
        public String ID { get; set; }

        /// <summary>
        /// 创建人
        /// </summary>
        public String CreatorId { get; set; }

        /// <summary>
        /// 商品名称
        /// </summary>
        public String GoodsName { get; set; }

        /// <summary>
        /// 品牌id
        /// </summary>
        public string Supplierid { get; set; }

        /// <summary>
        /// 商品类型id
        /// </summary>
        public String GoodsTypeId { get; set; }
        /// <summary>
        /// 是否特惠
        /// </summary>
        public Boolean? Preferential { get; set; }
        /// <summary>
        /// 划线价
        /// </summary>Marking price
        public decimal? MarkingPrice { get; set; }
        /// <summary>
        /// 商品描述
        /// </summary>
        public String GoodsDescribe { get; set; }
        /// <summary>
        /// 商品图片
        /// </summary>
        public String GoodsPic { get; set; }

        /// <summary>
        /// 规格
        /// </summary>
        public String Specifications { get; set; }
        /// <summary>
        /// 库存
        /// </summary>
        public int Inventory { get; set; }

        /// <summary>
        /// 规格id
        /// </summary>
        public String GoodsSpecificationsItemID { get; set; }

        /// <summary>
        /// 商品价格
        /// </summary>
        public Decimal GoodsPrices { get; set; }

        /// <summary>
        /// 销量
        /// </summary>
        public int SaleCount { get; set; } = 0;

        /// <summary>
        /// 是否热门
        /// </summary>
        public Boolean? IsHot { get; set; }

        /// <summary>
        /// 商品详情
        /// </summary>
        public String Details { get; set; }
        /// <summary>
        /// 预警库存
        /// </summary>
        public Int32? warning { get; set; }
        /// <summary>
        /// 二级分类
        /// </summary>
        public string RootTypeTwo { get; set; }
        /// <summary>
        /// 一级分类
        /// </summary>
        public string RootType { get; set; }

        /// <summary>
        /// 规格参数id
        /// </summary>
        public string Parameterid { get; set; }

        /// <summary>
        /// 库存
        /// </summary>
        public int Stock { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime CreateTime { get; set; }

        public DateTime _CreateTime { get { return DateTime.Parse(CreateTime.ToString("yyyy-MM-dd HH:mm:ss")); } set { CreateTime = value; } }

        /// <summary>
        /// 编辑人
        /// </summary>
        public String Editor { get; set; }

        /// <summary>
        /// 编辑时间
        /// </summary>
        public DateTime EditTime { get; set; }


        /// <summary>
        /// 是否删除
        /// </summary>
        public Boolean? Deleted { get; set; }
        /// <summary>
        /// 是否上架
        /// </summary>
        public Boolean? IsSale { get; set; }
        /// <summary>
        /// 商品参数
        /// </summary>
        public IEnumerable<BTB_GoodsParamete> Parametes { get; set; }
        /// <summary>
        /// 商品规格价格
        /// </summary>
        public IEnumerable<BTB_GoodsSpecificationsItem> SpecificationsItem { get; set; }
        public IEnumerable<BTB_GoodsSpecifications> Specificationsc { get; set; }
        public IEnumerable<BTB_Collection> Collection { get; set; }
        public IEnumerable<BTB_GoodsPic> GoodsPicS { get; set; }

        /// <summary>
        /// 商品标签Id列表
        /// </summary>
        public IEnumerable<GoodLable> LableList { get; set; }

        /// <summary>
        /// 商品专题Id列表
        /// </summary>
        public IEnumerable<GoodSpecial> SpecialList { get; set; }

        /// <summary>
        /// 首页商品类别(0.)
        /// </summary>
        public bool SpecialType { get; set; }

        public string SpecialId { get; set; }

        public string[] LableIds { get; set; }

        /// <summary>
        /// 是否积分商品
        /// </summary>
        public Boolean? IsPointGoods { get; set; } = false;

        /// <summary>
        /// 是否积分商品
        /// </summary>
        public int PointPrice { get; set; } = 0;

        /// <summary>
        /// 起始时间
        /// </summary>
        [NotMapped]
        public DateTime? StartTime { get; set; }

        /// <summary>
        /// 结束时间
        /// </summary>
        [NotMapped]
        public DateTime? EndTime { get; set; }
        /// <summary>
        /// 起始价格
        /// </summary>
        [NotMapped]
        public Decimal? StartPrices { get; set; }

        /// <summary>
        /// 结束价格
        /// </summary>
        [NotMapped]
        public Decimal? EndPrices { get; set; }
        [NotMapped]
        public String BTB_GoodsSpecificationsItemID { get; set; }

        /// <summary>
        /// 是否已收藏
        /// </summary>
        [NotMapped]
        public Boolean IsCollected { get; set; } = false;
    }

    public class TheGoodsDTO{
        public String ID { get; set; }

        /// <summary>
        /// 商品名称
        /// </summary>
        public String GoodsName { get; set; }

        /// <summary>
        /// 商品描述
        /// </summary>
        public String GoodsDescribe { get; set; }

        /// <summary>
        /// 划线价
        /// </summary>Marking price
        public decimal? MarkingPrice { get; set; }

        /// <summary>
        /// 二级分类
        /// </summary>
        public string RootTypeTwo { get; set; }

        /// <summary>
        /// 一级分类
        /// </summary>
        public string RootType { get; set; }

        /// <summary>
        /// 商品图片
        /// </summary>
        public String GoodsPic { get; set; }

        /// <summary>
        /// 商品价格
        /// </summary>
        public Decimal GoodsPrices { get; set; }

        /// <summary>
        /// 商品价格
        /// </summary>
        public Decimal PointPrices { get; set; }

        /// <summary>
        /// 销量
        /// </summary>
        public int SaleCount { get; set; } = 0;

        /// <summary>
        /// 是否热门
        /// </summary>
        public Boolean? IsHot { get; set; }

        /// <summary>
        /// 是否特惠
        /// </summary>
        public Boolean? Preferential { get; set; }

        /// <summary>
        /// 每日爆款
        /// </summary>
        public bool SpecialType { get; set; }
   
        /// <summary>
        /// 是否积分商品
        /// </summary>
        public bool IsPointGood { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime? CreateTime { get; set; }

        /// <summary>
        /// 库存
        /// </summary>
        public int Stock { get; set; }
    }

    public class GoodLable { 
        /// <summary>
        /// Id
        /// </summary>
        public string Id { set; get; }

        /// <summary>
        /// 标签名称
        /// </summary>
        public string LableName { set; get; }
    }

    public class GoodSpecial {
        /// <summary>
        /// Id
        /// </summary>
        public string Id { set; get; }


        /// <summary>
        /// 专题名称
        /// </summary>
        public string SpecialName { set; get; }
    }
}
